function share(title,desc,link,imgUrl,appId,timestamp,nonceStr,signature)
{
  var list = [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
		'hideOptionMenu',
      ];
  wx.config({
    debug: false,
    appId: appId,
    timestamp: timestamp,
    nonceStr: nonceStr,
    signature: signature,
    jsApiList:  list
  });
  
  wx.ready(function () {
    // 在这里调用 API
	 // 1 判断当前版本是否支持指定 JS 接口，支持批量判断
        wx.checkJsApi({
          jsApiList: list,
          success: function (res) {
                  var jso = JSON.stringify(res);
                // alert(jso);
              }
        });
		 // 1 监听"分享给朋友"，按钮点击、自定义分享内容及分享结果接口
        wx.onMenuShareAppMessage({
          title: title,
          desc: desc,
          link: link,
          imgUrl: imgUrl,
          trigger: function (res) {
           // alert('用户点击发送给朋友');
          },
          success: function (res) {
           // alert('已分享');
          },
          cancel: function (res) {
           // alert('已取消');
          },
          fail: function (res) {
           // alert(JSON.stringify(res));
          }
        });
		 wx.onMenuShareTimeline({
          title: title,
          link: link,
          imgUrl: imgUrl,
          trigger: function (res) {
           // alert('用户点击分享到朋友圈');
          },
          success: function (res) {
           // alert('已分享');
          },
          cancel: function (res) {
           // alert('已取消');
          },
          fail: function (res) {
           // alert(JSON.stringify(res));
          }
        });
        //分享到QQ
            // 3 监听"分享到QQ"按钮点击、自定义分享内容及分享结果接口
        wx.onMenuShareQQ({
              title: title,
              desc: desc,
              link: link,
              imgUrl: imgUrl,
              trigger: function (res) {
              //  alert('用户点击分享到QQ');
              },
              complete: function (res) {
              //  alert(JSON.stringify(res));
              },
              success: function (res) {
               // alert('已分享');
              },
              cancel: function (res) {
              //  alert('已取消');
              },
              fail: function (res) {
               // alert(JSON.stringify(res));
              }
            });
            // 4 监听"分享到微博"按钮点击、自定义分享内容及分享结果接口
        wx.onMenuShareWeibo({
              title: title,
              desc: desc,
              link: link,
              imgUrl: imgUrl,
              trigger: function (res) {
              //  alert('用户点击分享到微博');
              },
              complete: function (res) {
               // alert(JSON.stringify(res));
              },
              success: function (res) {
              //  alert('已分享');
              },
              cancel: function (res) {
              //  alert('已取消');
              },
              fail: function (res) {
              //  alert(JSON.stringify(res));
              }
            });           
  });	
}	

